#include "myserver.h"
#include "myclient.h"
#include <QDebug>

MyServer::MyServer(QObject *parent)
    : QTcpServer(parent)
{

}

void MyServer::startServer()
{
    if (this->listen(QHostAddress::Any, 1234)){
        qDebug() << "Server started.";
    }else{
        qDebug() << "Could not start server.";
    }
}

void MyServer::incomingConnection(qintptr socketDescriptor)
{
    MyClient *client = new MyClient(this);
    client->setSocketDescriptor(socketDescriptor);
}
